package cc.sunni.sleeve.core.config;

import cc.sunni.sleeve.core.hack.AutoPrefixUrlMapping;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

/**
 * 根据目录自动生成路由前缀
 * 通过配置类注册到容器 {@link cc.sunni.sleeve.core.hack.AutoPrefixUrlMapping}
 */
@Configuration
public class AutoPrefixConfiguration implements WebMvcRegistrations {

    @Override
    public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
        return new AutoPrefixUrlMapping();
    }
}
